<SCRIPT LANGUAGE="JavaScript">  
    function validation()
    {
        var temp="";

        temp=document.getElementById('AdvLink');
        if( temp.value.length == 0 )
        {
            temp.focus();
            temp.style.backgroundColor='#FF9';
            alert('Link iklan tidak boleh kosong !');
            temp.style.backgroundColor='#FFF';
            return false;             
        }
    }        
        
</SCRIPT>
<?php                                       
echo "<div class='form'>";
echo "<h2> Edit Iklan </h2>";
echo "<hr color='#2A7EF7'>";
        echo "<div class='kotak2'>";
        echo $form->create('Adv',array('action'=>'edit','type'=>'file','onsubmit'=>'return validation();'));
            echo $form->input('id');
            echo "<div class='input'><label>&nbsp</label>";
            if($this->data['Adv']['image']!='')
            {
                echo $html->image('../'.$this->data['Adv']['image'], array('alt' => 'Your File is Missing','class'=>'adv'));
            }
            echo "<br><label>&nbsp</label><span class='info'>Biarkan tetap kosong jika anda tidak ingin mengubah logo.</span>";
            echo "</div>";
            echo $form->input('image',array('type'=>'file','label'=>'Edit Logo'));
            echo $form->input('link',array('size'=>'40'));
        echo "<div class='input'><label>".$html->link('[ Kembali ]',array('controller'=>'advs','action'=>'my_advs'))."</label><input type='submit' value='Submit'></div>";
    echo "</form>";   
    echo "</div>"; 
    echo ":. Format file harus <span class='red'>Image (.jpg or .jpeg or .gif or .png) </span>";
    echo "<br>:. Ukuran foto yang dianjurkan adalah <span class='red'>250 x 100</span> pixel";
    echo "<br>:. URL link harus diawali dengan <span class='red'>'http://'</span>";  
echo "</div>";